package com.unimas.dof.converter;

import java.util.HashMap;
import java.util.Map;

import com.unimas.dof.BinaryFile;

public class ConverterUtils {
	
	private static Map<Class,Converter> converters = new HashMap<Class,Converter>();
	
	static {
		converters.put(String.class, new StringConverter());
		converters.put(int.class, new IntegerConverter());
		converters.put(boolean.class, new BooleanConverter());
		converters.put(BinaryFile.class, new BinaryFileConverter());
	}
	
	public static void register(Class clas,Converter converter){
		converters.put(clas, converter);
	}
	
	public static Converter getConverter(Class clas){
		return converters.get(clas);
	}
}
